﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">

body, td, th, input, select, textarea, option, optgroup {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
    </style>
</head>
<body>
<script>

    function confirm_delete() {
        if (confirm("Are you sure you want to delete ?") == true)
            return true;
        else
            return false;
    }
</script>
    <form id="form1" runat="server">
    <div>
    
    <asp:DataList ID="dlManuFac" runat="server" Width="946px" DataKeyField="manufacturer_id" 
            onupdatecommand="dlManuFac_UpdateCommand" 
            ondeletecommand="dlManuFac_DeleteCommand" 
            oneditcommand="dlManuFac_EditCommand">
        <EditItemTemplate>
            <table style="width: 100%;">
                <tr>
                    <td class="style6">
                        <asp:Label ID="Label1" runat="server" Text="Name ManuFacture :"></asp:Label>
                    </td>
                    <td class="style5">
                        <asp:TextBox ID="txtNameManu" runat="server" Text='<%# Eval("name") %>'></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style6">
                        <asp:Label ID="Label5" runat="server" Text="Image :"></asp:Label>
                    </td>
                    <td class="style5" align="justify" valign="middle">
                        <asp:Image ID="Image" runat="server" Height="92px" Width="115px" ImageUrl='<%# Eval("image") %>'/>
                            &nbsp;<asp:FileUpload ID="fileUpload" runat="server" />
                        <br />
                        <asp:Label ID="lblFileInfo" runat="server" Text='<%# Eval("image") %>'></asp:Label>
                        <br />
                        <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="Upload" 
                              />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:Button ID="Button1" runat="server" Text="Save" onclick="Button1_Click" CommandName="Update" />
                            &nbsp;<asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                                Text="Cancel" />
                    </td>
                </tr>
            </table>
        </EditItemTemplate>
        <HeaderTemplate>
            <table style="width: 100%;" align="center" border="1" cellpadding="0" cellspacing="0">
                <tr bgcolor="#00CCFF">
                    <th align="center" class="style3">
                            Action
                        </th>
                    <th align="center">
                             Manufacture name
                        </th>
                    <th align="center">
                            Img
                        </th>
                </tr>
        </HeaderTemplate>
        <ItemTemplate>
            <tr>
                <td style="text-align: center">
                    <asp:ImageButton AlternateText="Edit" ImageUrl="~/image/Edit.gif" ID="EditLinkButton"
                            CommandName="Edit" Text="Edit" runat="server" 
                       />
                    &nbsp;
                            <asp:ImageButton AlternateText="Delete"
                                ImageUrl="~/image/Delete.gif" ID="DeleteLinkButton" CommandName="Delete" Text="Delete"
                                runat="server" OnClientClick = "return confirm_delete();" />
                </td>
                <td style="text-align: center">
                    <%# Eval("name")%>
                </td>
                <td style="text-align: center">
                    <%# Eval("image")%>
                </td>
            </tr>
        </ItemTemplate>
    </asp:DataList>
    
    </div>
    </form>
</body>
</html>
